//
//  NoNetworkView.swift
//  Employee
//
//  Created by swordjoy on 2017/4/24.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import UIKit

class NoNetworkView: UIView {

  fileprivate var pointImageView: UIImageView!
  
  fileprivate var tipLabel: UILabel!
  
  override init(frame: CGRect) {
    super.init(frame: frame)
    
    backgroundColor = GlobalConfig.GrapeFruitColor
    
    create()
    
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

}

// MARK: - fileprivate

extension NoNetworkView {
  
  fileprivate func create() {
    
    tipLabel = UILabel()
    addSubview(tipLabel)
    tipLabel.textColor = UIColor.white
    tipLabel.text = "当前网络不可用,请检查您的网络设置"
    tipLabel.font = GlobalConfig.system15Font
    tipLabel.snp.makeConstraints { (make) in
      make.centerY.equalToSuperview()
      make.centerX.equalToSuperview()
    }
    
    pointImageView = UIImageView()
    addSubview(pointImageView)
    pointImageView.image = UIImage(named: "warin-icon")
    pointImageView.snp.makeConstraints { (make) in
      make.centerY.equalToSuperview()
      make.right.equalTo(tipLabel.snp.left).offset(-10)
      make.width.equalTo(20)
      make.height.equalTo(16)
    }
    
    
  }
  
}
